<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends CommonController {
	public function index() {
		$this->display('index/main');
	}
	public function user_kcjb() {
		$xz_var_99 = I('post.ID');
		$xz_var_363 = I('post.mag');
		$xz_var_204 = I('post.num');
		if ($xz_var_99 && $xz_var_363 && $xz_var_204 > 0) {
			$xz_var_210 = M('user')->where(array('Id' => $xz_var_99))->find();
			if ($xz_var_210) {
				M('user')->startTrans();
				$xz_var_66 = M('user')->where(array('Id' => $xz_var_99))->setDec('monery', $xz_var_204);
				$xz_var_312['type'] = 2;
				$xz_var_312['amount'] = $xz_var_204;
				$xz_var_312['info'] = $xz_var_363 . '-' . $_SESSION['adminuser'];
				$xz_var_312['time'] = time();
				$xz_var_312['uid'] = $xz_var_99;
				$xz_var_296 = M('monery')->data($xz_var_312)->add();
				if ($xz_var_66 && $xz_var_296) {
					M('user')->commit();
					$this->success('修改成功!');
				} else {
					M('user')->rollback();
					$this->success('修改失败!');
				}
			}
		}
	}
	public function main() {
		$this->times = date('Y-m-d H:i:s', time());
		$this->countmember = M('user')->count();
		$xz_var_75['date'] = array('GT', date('Y-m-d H:i:s', time() - 3600));
		$this->onlinemember = M('denglu')->where($xz_var_75)->group('uid')->count();
		$xz_var_75 = array();
		$xz_var_75['regtime'] = array('GT', date('Y-m-d', time()));
		$this->daymember = M('user')->where($xz_var_75)->count();
		$xz_var_75 = array();
		$xz_var_75['WStatus'] = array('LT', 2);
		$this->alldrawal = M('withdrawal')->where($xz_var_75)->sum('RealMoney');
		$this->enddrawal = M('withdrawal')->where(array('WStatus' => 1))->sum('RealMoney');
		$this->waitdrawal = M('withdrawal')->where(array('WStatus' => 0))->sum('RealMoney');
		$this->alldrawal_n = M('withdrawal')->where($xz_var_75)->count();
		$this->enddrawal_n = M('withdrawal')->where(array('WStatus' => 1))->count();
		$this->waitdrawal_n = M('withdrawal')->where(array('WStatus' => 0))->count();
		$this->allpay = M('withpay')->sum('realmoney');
		$this->endpay = M('withpay')->where(array('paystatus' => 1))->sum('realmoney');
		$this->waitpay = M('withpay')->where(array('paystatus' => 0))->sum('realmoney');
		$this->allpay_n = M('withpay')->count();
		$this->endpay_n = M('withpay')->where(array('paystatus' => 1))->count();
		$this->waitpay_n = M('withpay')->where(array('paystatus' => 0))->count();
		$this->allmsg = M('message')->count();
		$this->wailmsg = M('message')->where(array('status' => 0))->count();
		$xz_var_75 = array();
		$xz_var_75['status'] = array('GT', 0);
		$this->engmsg = M('message')->where($xz_var_75)->count();
		$xz_var_75 = array();
		$xz_var_75['CreateTime'] = array('GT', strtotime(date('Y-m-d', time())));
		$xz_var_184 = M('bet')->where($xz_var_75)->sum('zMoney');
		$xz_var_384 = M('bet')->where($xz_var_75)->sum('fMoney');
		$this->moneryonline = $xz_var_184 + $xz_var_384;
		$xz_var_181 = M('bet')->where(array('BetStatus' => 2))->sum('zMoney');
		$xz_var_379 = M('bet')->where(array('BetStatus' => 2))->sum('fMoney');
		$xz_var_237 = M('bet')->where(array('BetStatus' => 2))->sum('winMoney');
		$this->monerywin = $xz_var_181 + $xz_var_379 - $xz_var_237;
		$this->isuse = M('lotteryrecord')->order('Id desc')->find();
		$this->display('index/main');
	}
	public function Getdat() {
		$xz_var_65 = strtotime(date('Y-m-d', time()));
		for ($xz_var_236 = 0;$xz_var_236 < 24;$xz_var_236++) {
			$xz_var_57 = $xz_var_65 + 3600;
			$xz_var_293 = array();
			$xz_var_293['CreateTime'] = array('between', array($xz_var_65, $xz_var_57));
			$xz_var_186[] = (int)M('bet')->where($xz_var_293)->sum('zMoney');
			$xz_var_226[] = (int)M('bet')->where($xz_var_293)->sum('fMoney');
			$xz_var_65 = $xz_var_65 + 3600;
		}
		$xz_var_380['zz'] = $xz_var_186;
		$xz_var_380['ff'] = $xz_var_226;
		$this->ajaxReturn($xz_var_380);
	}
	public function chongzhi() {
		$xz_var_308 = M('withpay');
		$xz_var_54 = trim(I('post.user'));
		if ($xz_var_54 <> '') {
			$xz_var_183['orderid'] = $xz_var_54;
		}
		$xz_var_222 = $xz_var_308->where($xz_var_183)->count();
		$xz_var_180 = getpage($xz_var_222, 20);
		$xz_var_289 = $xz_var_308->where($xz_var_183)->order('paystatus,creattime desc')->limit($xz_var_180->firstRow, $xz_var_180->listRows)->select();
		foreach ($xz_var_289 as $xz_var_220 => $xz_var_62) {
			$xz_var_289[$xz_var_220]['creattime'] = date('Y-m-d H:i:s', $xz_var_289[$xz_var_220]['creattime']);
			if ($xz_var_289[$xz_var_220]['bankid'] == 301) {
				$xz_var_289[$xz_var_220]['bankname'] = '支付宝';
			} elseif ($xz_var_289[$xz_var_220]['bankid'] == 401) {
				$xz_var_289[$xz_var_220]['bankname'] = '微信';
			} elseif ($xz_var_289[$xz_var_220]['bankid'] == 501) {
				$xz_var_289[$xz_var_220]['bankname'] = 'QQ钱包';
			}
		}
		$this->assign('list', $xz_var_289);
		$this->assign('page', $xz_var_180->show());
		$this->display('index/chongzhi');
	}
	public function czqr() {
		$xz_var_163 = (int)I('get.id');
		if (!$xz_var_163) return;
		$xz_var_60 = M('withpay')->where(array('Id' => $xz_var_163, 'paystatus' => 0))->find();
		if ($xz_var_60) {
			$xz_var_276 = time();
			M('user')->startTrans();
			$xz_var_271 = array();
			$xz_var_271['paytime'] = $xz_var_276;
			$xz_var_271['paystatus'] = 1;
			$xz_var_94 = M('withpay')->where(array('Id' => $xz_var_163))->data($xz_var_271)->save();
			$xz_var_93 = M('user')->where(array('Id' => $xz_var_60['uid']))->setInc('monery', $xz_var_60['gamemoney']);
			$xz_var_93 = M('user')->where(array('Id' => $xz_var_60['uid']))->setInc('payall', $xz_var_60['gamemoney']);
			$xz_var_271 = array();
			$xz_var_271['type'] = 1;
			$xz_var_271['amount'] = $xz_var_60['gamemoney'];
			$xz_var_271['info'] = $xz_var_60['orderid'] . '手动确认' . $_SESSION['adminuser'];
			$xz_var_271['time'] = $xz_var_276;
			$xz_var_271['uid'] = $xz_var_60['uid'];
			$xz_var_219 = M('monery')->data($xz_var_271)->add();
			if ($xz_var_94 && $xz_var_93 && $xz_var_219) {
				M('user')->commit();
				$this->success('确认成功!');
			} else {
				M('user')->rollback();
				$this->error('确认失败!');
			}
		}
	}
	public function liuyan() {
		$this->display('index/liuyan');
	}
	public function GetEmailList() {
		$xz_var_268 = I('post.rows', 10, 'int');
		$xz_var_96 = I('post.page', 1, 'int');
		$xz_var_278 = M('message')->order('status,createtime desc')->page($xz_var_96, $xz_var_268)->select();
		$xz_var_286['total'] = M('message')->count();
		$xz_var_286['rows'] = $xz_var_278;
		$this->ajaxReturn($xz_var_286);
	}
	public function EmailReply() {
		$xz_var_382 = trim(I('get.id', 0, 'int'));
		if (!$xz_var_382) return;
		$xz_var_82 = M('message')->where(array('Id' => $xz_var_382))->find();
		if (!$xz_var_82) return;
		$xz_var_81 = M('messageadd')->where(array('mid' => $xz_var_382))->order('time asc')->select();
		$this->list = $xz_var_82;
		$this->list2 = $xz_var_81;
		$this->display('index/EmailReply');
	}
	public function EmailReplyData() {
		$xz_var_283 = trim(I('post.id', 0, 'int'));
		$xz_var_164 = substr(I('post.EmailReplyContent'), 0, 200);
		if (!$xz_var_283) return;
		$xz_var_217['mid'] = $xz_var_283;
		$xz_var_217['content'] = $xz_var_164;
		$xz_var_217['time'] = time();
		$xz_var_282 = M('messageadd')->data($xz_var_217)->add();
		M('message')->where(array('Id' => $xz_var_283))->data(array('status' => 1))->save();
		$xz_var_84['Success'] = true;
		$this->ajaxReturn($xz_var_84);
	}
	public function tixian() {
		$xz_var_307 = M('withdrawal');
		$xz_var_87 = trim(I('post.user'));
		if ($xz_var_87) {
			$xz_var_86['order'] = $xz_var_87;
		}
		$xz_var_225 = $xz_var_307->where($xz_var_86)->count();
		$xz_var_315 = getpage($xz_var_225, 20);
		$xz_var_51 = $xz_var_307->where($xz_var_86)->order('WStatus,time')->limit($xz_var_315->firstRow, $xz_var_315->listRows)->select();
		foreach ($xz_var_51 as $xz_var_18 => $xz_var_375) {
			$xz_var_51[$xz_var_18]['time'] = date('Y-m-d H:i', $xz_var_375['time']);
		}
		$this->assign('list', $xz_var_51);
		$this->assign('page', $xz_var_315->show());
		$this->display('index/tixian');
	}
	public function tixiancl() {
		$xz_var_178 = M('withdrawal');
		$xz_var_154 = I('get.cl');
		$xz_var_156 = I('get.dl');
		$xz_var_361 = I('get.fh');
		$xz_var_360 = I('get.sc');
		if ($xz_var_154) {
			$xz_var_227 = $xz_var_178->where(array('Id' => $xz_var_154, 'WStatus' => 0))->find();
			if ($xz_var_227) {
				$xz_var_20 = $xz_var_178->where(array('Id' => $xz_var_154))->data(array('WStatus' => 1))->save();
				$xz_var_357['type'] = 4;
				$xz_var_357['amount'] = $xz_var_227['gamemoney'];
				$xz_var_357['info'] = $xz_var_227['order'] . '提款确认-' . $_SESSION['adminuser'];
				$xz_var_357['time'] = time();
				$xz_var_357['uid'] = $xz_var_227['uid'];
				$xz_var_358 = M('monery')->data($xz_var_357)->add();
				if ($xz_var_20 && $xz_var_358) {
					M('user')->commit();
					$this->success('提款确认成功!');
				} else {
					M('user')->rollback();
					$this->error('提款确认失败!');
				}
			}
		} else if ($xz_var_156) {
			$xz_var_20 = $xz_var_178->where(array('Id' => $xz_var_156))->data(array('WStatus' => 2))->save();
			if ($xz_var_20) {
				M('user')->commit();
				$this->success('操作成功!');
			} else {
				M('user')->rollback();
				$this->error('操作失败!');
			}
		} else if ($xz_var_361) {
			$xz_var_227 = $xz_var_178->where(array('Id' => $xz_var_361, 'WStatus' => 0))->find();
			if ($xz_var_227) {
				M('user')->startTrans();
				$xz_var_20 = M('user')->where(array('Id' => $xz_var_227['uid']))->setInc('monery', $xz_var_227['gamemoney']);
				$xz_var_324 = $xz_var_178->where(array('Id' => $xz_var_361))->data(array('WStatus' => 3))->save();
				$xz_var_357['type'] = 1;
				$xz_var_357['amount'] = $xz_var_227['gamemoney'];
				$xz_var_357['info'] = $xz_var_227['order'] . '返还-' . $_SESSION['adminuser'];
				$xz_var_357['time'] = time();
				$xz_var_357['uid'] = $xz_var_227['uid'];
				$xz_var_358 = M('monery')->data($xz_var_357)->add();
				if ($xz_var_20 && $xz_var_358) {
					M('user')->commit();
					$this->success('返还成功!');
				} else {
					M('user')->rollback();
					$this->error('返还失败!');
				}
			}
		} else if ($xz_var_360) {
			$xz_var_227 = $xz_var_178->where(array('Id' => $xz_var_360, 'WStatus' => 0))->find();
			if ($xz_var_227) {
				M('user')->startTrans();
				$xz_var_20 = $xz_var_178->where(array('Id' => $xz_var_360))->delete();
				$xz_var_357['type'] = 5;
				$xz_var_357['amount'] = $xz_var_227['gamemoney'];
				$xz_var_357['info'] = $xz_var_227['order'] . '删除-' . $_SESSION['adminuser'];
				$xz_var_357['time'] = time();
				$xz_var_357['uid'] = $xz_var_227['uid'];
				$xz_var_358 = M('monery')->data($xz_var_357)->add();
				if ($xz_var_20 && $xz_var_358) {
					M('user')->commit();
					$this->success('删除成功!');
				} else {
					M('user')->rollback();
					$this->error('删除失败!');
				}
			}
		}
	}
	public function admin_add() {
		$this->display('index/admin_add');
	}
	public function df1() {
		$xz_var_368 = date('Y');
		$xz_var_321 = date('m');
		$xz_var_370 = date('d');
		$xz_var_12 = date('d') - 1;
		$xz_var_158 = mktime(0, 0, 0, $xz_var_321, $xz_var_370, $xz_var_368);
		$xz_var_165 = mktime(23, 59, 59, $xz_var_321, $xz_var_370, $xz_var_368);
		$xz_var_334 = mktime(0, 0, 0, $xz_var_321, $xz_var_12, $xz_var_368);
		$xz_var_2 = mktime(23, 59, 59, $xz_var_321, $xz_var_12, $xz_var_368);
		$xz_var_0 = date('Y-m-d H:i:s', $xz_var_158);
		$xz_var_206 = date('Y-m-d H:i:s', $xz_var_165);
		$xz_var_332 = date('Y-m-d H:i:s', $xz_var_334);
		$xz_var_166 = date('Y-m-d H:i:s', $xz_var_2);
		$xz_var_11 = M('system')->where(array('SYS_ID' => 1))->find();
		$this->zt = $xz_var_11;
		$xz_var_327 = M('drrz')->where(array('user' => $_SESSION['adminuser'], 'leixin' => 1))->order('id DESC')->limit(2)->select();
		$this->bcip = $xz_var_327[0];
		$this->scip = $xz_var_327[1];
		$this->jtzchy = M('user')->where("`UE_regTime`> '" . $xz_var_0 . "' AND `UE_regTime` < '" . $xz_var_206 . "'")->count('UE_ID');
		$this->jtjhhy = M('user')->where("`UE_activeTime`> '" . $xz_var_0 . "' AND `UE_activeTime` < '" . $xz_var_206 . "'")->count('UE_ID');
		$this->ztzchy = M('user')->where("`UE_regTime`> '" . $xz_var_332 . "' AND `UE_regTime` < '" . $xz_var_166 . "'")->count('UE_ID');
		$this->ztjhhy = M('user')->where("`UE_activeTime`> '" . $xz_var_332 . "' AND `UE_activeTime` < '" . $xz_var_166 . "'")->count('UE_ID');
		$this->zuser = M('user')->where("`UE_ID`> '0'")->count('UE_ID');
		$this->zjhuser = M('user')->where("`UE_ID`> '0' AND `UE_check` = '1'")->count('UE_ID');
		$this->zcjuser = M('user')->where("`UE_ID`> '0' AND `UE_check` = '1' AND `UE_stop` = '0'")->count('UE_ID');
		$this->zjb = M('user')->sum('UE_money');
		$this->zyb = M('user')->sum('ybhe');
		$this->zzsb = M('user')->sum('zsbhe');
		$this->display('index/index');
	}
	public function gb() {
		M('system')->where(array('SYS_ID' => 1))->save(array('zt' => 1));
		$this->success('关闭成功!');
	}
	public function kq() {
		M('system')->where(array('SYS_ID' => 1))->save(array('zt' => 0));
		$this->success('开启成功!');
	}
	public function top() {
		$this->display('index/top');
	}
	public function team() {
		$this->user = I('get.user', '0');
		$this->display('index/team');
	}
	public function left() {
		$this->display('index/left');
	}
	public function user_xg() {
		$xz_var_190 = trim(I('get.user'));
		if ($xz_var_190 <> '') {
			$xz_var_194 = M('user')->where(array('Id' => $xz_var_190))->find();
			$xz_var_194['regtime'] = date('Y-m-d H:i:s', $xz_var_194['regtime']);
			$xz_var_194['ipcf'] = M('user')->where(array('regip' => $xz_var_194['regip']))->count();
			$xz_var_194['refcount'] = M('user')->where(array('tid' => $xz_var_194['id']))->count();
			$xz_var_211 = M('user')->where(array('tid' => $xz_var_194['id']))->group('regip')->count();
			$xz_var_194['refipzl'] = $xz_var_211 / $xz_var_194['refcount'];
			$xz_var_194['withpayz'] = M('withpay')->where(array('uid' => $xz_var_194['id'], 'paystatus' => 1))->sum('realmoney');
			$xz_var_25 = 0;
			$xz_var_279 = 0;
			$xz_var_269 = M('user')->where(array('tid' => $xz_var_194['id']))->select();
			foreach ($xz_var_269 as $xz_var_306 => $xz_var_175) {
				$xz_var_42 = M('withpay')->where(array('uid' => $xz_var_175['id'], 'paystatus' => 1))->select();
				if ($xz_var_42) {
					$xz_var_279 = $xz_var_279 + 1;
					foreach ($xz_var_42 as $xz_var_176 => $xz_var_167) {
						$xz_var_25 = $xz_var_25 + $xz_var_167['realmoney'];
					}
				}
			}
			$xz_var_194['refczz'] = $xz_var_25;
			$xz_var_194['refuserz'] = $xz_var_279;
			$this->userdata = $xz_var_194;
			$this->display('index/user_xg');
		} else {
			$this->display('index/userlist');
		}
	}
	public function tixian_xg() {
		if (I('get.id') <> '') {
			$this->userdata = M('tixian')->where(array('id' => I('get.id')))->find();
			$this->display('index/tixian_xg');
		} else {
			$this->error('非法操作!');
		}
	}
	public function admin_xg() {
		$this->display('index/admin_xg');
	}
	public function usercl() {
		$xz_var_365 = I('post.ID');
		$xz_var_325['status'] = I('post.status');
		if (I('post.password') <> '') {
			$xz_var_325['password'] = md5(I('post.password'));
		}
		$xz_var_325['vip1'] = I('post.vip1');
		if (!$xz_var_365) return;
		$xz_var_202 = M('user')->where(array('Id' => $xz_var_365))->data($xz_var_325)->save();
		if ($xz_var_202) {
			$this->success('修改成功!');
		} else {
			$this->success('修改失败!');
		}
	}
	public function admincl() {
		if (I('post.MB_fio') <> '') {
			$xz_var_159['MB_fio'] = I('post.MB_fio');
		}
		if (I('post.MB_userpwd') <> '') {
			$xz_var_159['MB_userpwd'] = md5(I('post.MB_userpwd'));
		}
		$xz_var_170 = M('member')->where(array('	MB_username' => $_SESSION['adminuser']))->save($xz_var_159);
		if ($xz_var_170) {
			$this->success('修改成功!', '/Index/adminlist');
		} else {
			$this->success('修改失败!');
		}
	}
	public function adminadd() {
		$xz_var_169['MB_username'] = I('post.MB_username');
		$xz_var_169['MB_right'] = I('post.MB_right');
		$xz_var_169['MB_userpwd'] = md5(I('post.MB_userpwd'));
		$xz_var_169['MB_fio'] = I('post.MB_fio');
		if (I('post.MB_username') <> '' && I('post.MB_right') <> '' && I('post.MB_userpwd') <> '') {
			if (M('member')->add($xz_var_169)) {
				$this->success('添加成功!', '/Index/adminlist');
			} else {
				$this->success('添加失败!');
			}
		} else {
			$this->success('数据不能为空!');
		}
	}
	public function txlist() {
		$xz_var_168 = M('tixian');
		$xz_var_263 = I('post.user');
		if ($xz_var_263 <> '') {
			$xz_var_171['UE_account'] = $xz_var_263;
		}
		if (I('get.ip') <> '') {
			$xz_var_171['UE_regIP'] = I('get.ip');
		}
		$xz_var_172 = $xz_var_168->where($xz_var_171)->count();
		$xz_var_264 = getpage($xz_var_172, 20);
		$xz_var_377 = $xz_var_168->where($xz_var_171)->order('id')->limit($xz_var_264->firstRow, $xz_var_264->listRows)->select();
		$this->assign('list', $xz_var_377);
		$this->assign('page', $xz_var_264->show());
		$this->display('index/txlist');
	}
	public function mavros9_del() {
		M('mavro')->where(array('status' => 9))->delete();
		M('mavro_add')->where(array('status' => 9))->delete();
		M('tgbz')->where(array('status' => 9))->delete();
	}
	public function userlist() {
		$xz_var_303 = M('user');
		$xz_var_29 = trim(I('post.user'));
		if ($xz_var_29 <> '') {
			$xz_var_27['username'] = array('EQ', $xz_var_29);
			$xz_var_27['email'] = array('EQ', $xz_var_29);
			$xz_var_27['regip'] = array('EQ', $xz_var_29);
			$xz_var_27['tid'] = array('EQ', $xz_var_29);
			$xz_var_27['_logic'] = 'or';
			$xz_var_28['_complex'] = $xz_var_27;
			$xz_var_28['Id'] = array('GT', 1);
			$xz_var_265 = $xz_var_303->where($xz_var_28)->count();
			$this->assign('count', $xz_var_265);
			$xz_var_174 = $xz_var_303->where($xz_var_28)->order('Id desc')->select();
		} else {
			$xz_var_265 = $xz_var_303->where($xz_var_28)->count();
			$xz_var_266 = getpage($xz_var_265, 20);
			$xz_var_174 = $xz_var_303->where($xz_var_28)->order('ID desc')->limit($xz_var_266->firstRow, $xz_var_266->listRows)->select();
			$this->assign('count', $xz_var_265);
			$this->assign('page', $xz_var_266->show());
		}
		foreach ($xz_var_174 as $xz_var_339 => $xz_var_35) {
			$xz_var_174[$xz_var_339]['regtime'] = date('Y-m-d H:i', $xz_var_174[$xz_var_339]['regtime']);
			$xz_var_174[$xz_var_339]['t'] = M('user')->where(array('Id' => $xz_var_35['tid']))->find();
		}
		$this->assign('list', $xz_var_174);
		$this->display('index/userlist');
	}
	public function userlist2() {
		$xz_var_173 = M('user');
		$xz_var_316 = I('post.user');
		if ($xz_var_316 <> '') {
			$xz_var_16['UE_vermail'] = $xz_var_316;
		}
		if (I('get.ip') <> '') {
			$xz_var_16['UE_regIP'] = I('get.ip');
		}
		$xz_var_16['uc'] = 1;
		$xz_var_373 = $xz_var_173->where($xz_var_16)->count();
		$xz_var_337 = getpage($xz_var_373, 20);
		$xz_var_336 = $xz_var_173->where($xz_var_16)->order('UE_ID')->limit($xz_var_337->firstRow, $xz_var_337->listRows)->select();
		$this->assign('list', $xz_var_336);
		$this->assign('page', $xz_var_337->show());
		$this->display('index/userlist2');
	}
	public function pai_add() {
		$this->display('index/pai_add');
	}
	public function pai_add_cl() {
		if (IS_POST) {
			$xz_var_335 = I('post.');
			$xz_var_319 = M('user')->where(array('UE_account' => $xz_var_335['user']))->find();
			if (!$xz_var_319) {
				$this->error('用户 不存在！');
			} elseif (!preg_match('/^[0-9.]{1,10}$/', $xz_var_335['sl'])) {
				$this->error('请填生成数量！');
			} else {
				$xz_var_362 = 0;
				for ($xz_var_353 = 0;$xz_var_353 < $xz_var_335['sl'];$xz_var_353++) {
					$xz_var_45 = md5(sprintf('%0' . strlen(9) . 'd', mt_rand(0, 99999999999)));
					if (!M('pai')->where(array('pin' => $xz_var_45))->find()) {
						$xz_var_249['user'] = $xz_var_335['user'];
						$xz_var_249['pin'] = $xz_var_45;
						$xz_var_249['zt'] = 0;
						$xz_var_249['sc_date'] = date('Y-m-d H:i:s', time());
						if (M('pai')->add($xz_var_249)) {
							$xz_var_362++;
						}
					}
				}
				$this->success('成功添加排单码' . $xz_var_362 . '个');
			}
		}
	}
	public function pai_list() {
		$xz_var_157 = M('pai');
		$xz_var_43 = I('post.user');
		$xz_var_157->count();
		if (I('get.cz') == 0) {
			$xz_var_369['zt'] = 0;
		}
		if (I('get.cz') == 1) {
			$xz_var_369['zt'] = 1;
		}
		if ($xz_var_43 <> '') {
			$xz_var_369['user'] = $xz_var_43;
		}
		$xz_var_155 = $xz_var_157->where($xz_var_369)->count();
		$xz_var_345 = getpage($xz_var_155, 20);
		$xz_var_262 = $xz_var_157->where($xz_var_369)->order('id DESC')->limit($xz_var_345->firstRow, $xz_var_345->listRows)->select();
		$this->assign('list', $xz_var_262);
		$this->assign('page', $xz_var_345->show());
		$this->display('index/pai_list');
	}
	public function pai_del() {
		$xz_var_376 = M('user');
		$xz_var_160 = I('get.id');
		if (M('pai')->where(array('id' => $xz_var_160))->delete()) {
			$this->success('删除成功!');
		} else {
			$this->success('删除失败!');
		}
	}
	public function adminlist() {
		$xz_var_240 = M('member');
		$xz_var_242 = I('post.user');
		if ($xz_var_242 <> '') {
			$xz_var_17['MB_username'] = $xz_var_242;
		}
		$xz_var_162 = $xz_var_240->where($xz_var_17)->count();
		$xz_var_161 = getpage($xz_var_162, 20);
		$xz_var_78 = $xz_var_240->where($xz_var_17)->order('MB_ID')->limit($xz_var_161->firstRow, $xz_var_161->listRows)->select();
		$this->assign('list', $xz_var_78);
		$this->assign('page', $xz_var_161->show());
		$this->display('index/adminlist');
	}
	public function userdel() {
		$xz_var_177 = M('user');
		$xz_var_89 = I('get.id');
		$xz_var_187 = M('user')->where(array('UE_ID' => $xz_var_89))->find();
		if ($xz_var_89 <> '' && $xz_var_187['ue_account'] <> '') {
			M('user')->where(array('UE_ID' => $xz_var_89))->delete();
			$this->success('删除成功!');
		} else {
			$this->success('公司账号不能删除!');
		}
	}
	public function ppdd_list_del() {
		$xz_var_304 = M('user');
		$xz_var_311 = I('get.id');
		$xz_var_59 = M('ppdd')->where(array('id' => $xz_var_311))->find();
		if ($xz_var_311 <> '' && $xz_var_59['id'] <> '') {
			M('ppdd')->where(array('id' => $xz_var_311))->delete();
			M('tgbz')->where(array('id' => $xz_var_59['p_id']))->delete();
			M('jsbz')->where(array('id' => $xz_var_59['g_id']))->delete();
			$this->success('删除成功!');
		} else {
			$this->success('订单不存在!');
		}
	}
	public function tgbz_list_del() {
		$xz_var_182 = M('user');
		$xz_var_258 = I('get.id');
		$xz_var_256 = M('tgbz')->where(array('id' => $xz_var_258))->find();
		if ($xz_var_258 <> '' && $xz_var_256['id'] <> '') {
			M('tgbz')->where(array('id' => $xz_var_256['id']))->delete();
			$this->success('删除成功!');
		} else {
			$this->success('订单不存在!');
		}
	}
	public function jsbz_list_del() {
		$xz_var_292 = M('user');
		$xz_var_252 = I('get.id');
		$xz_var_347 = M('jsbz')->where(array('id' => $xz_var_252))->find();
		if ($xz_var_252 <> '' && $xz_var_347['id'] <> '') {
			M('jsbz')->where(array('id' => $xz_var_347['id']))->delete();
			$this->success('删除成功!');
		} else {
			$this->success('订单不存在!');
		}
	}
	public function admindel() {
		$xz_var_317 = M('member');
		$xz_var_67 = I('get.id');
		$xz_var_179 = M('member')->where(array('MB_ID' => $xz_var_67))->find();
		if ($xz_var_67 <> '' && $xz_var_179['mb_username'] <> '') {
			M('member')->where(array('MB_ID' => $xz_var_67))->delete();
			$this->success('删除成功!', '/Index/adminlist');
		} else {
			$this->success('不能删除!');
		}
	}
	public function usermb() {
		$xz_var_185 = M('user');
		$xz_var_374 = I('get.id');
		$xz_var_6 = M('user')->where(array('UE_ID' => $xz_var_374))->find();
		if ($xz_var_374 <> '' && $xz_var_6['ue_account'] <> '') {
			if (M('user')->where(array('UE_ID' => $xz_var_374))->save(array('UE_question' => '', 'UE_question2' => '', 'UE_question3' => '', 'UE_answer' => '', 'UE_answer2' => '', 'UE_answer3' => ''))) {
				$this->success('成功!');
			} else {
				$this->success('失败!');
			}
		} else {
			$this->success('用户不存在!');
		}
	}
	public function userbtc() {
		$xz_var_364 = M('user');
		$xz_var_69 = I('get.cz');
		if ($xz_var_69 == 'n') {
			$xz_var_68['btbdz'] = '0';
		} elseif ($xz_var_69 == 'y') {
			$xz_var_68['btbdz'] = array('neq', '0');
		}
		$xz_var_255 = $xz_var_364->where($xz_var_68)->count();
		$xz_var_71 = getpage($xz_var_255, 20);
		$xz_var_254 = $xz_var_364->where($xz_var_68)->order('UE_ID')->limit($xz_var_71->firstRow, $xz_var_71->listRows)->select();
		$this->assign('list', $xz_var_254);
		$this->assign('page', $xz_var_71->show());
		$this->display('index/userbtc');
	}
	public function rggl() {
		$xz_var_253 = M('userjyinfo');
		$xz_var_104 = I('get.cz');
		if ($xz_var_104 == 'n') {
			$xz_var_284['UJ_jbmcStage'] = '0';
		} elseif ($xz_var_104 == 'y') {
			$xz_var_284['UJ_jbmcStage'] = '1';
		}
		$xz_var_284['UJ_dataType'] = 'rg';
		$xz_var_110 = $xz_var_253->where($xz_var_284)->count();
		$xz_var_73 = getpage($xz_var_110, 20);
		$xz_var_102 = $xz_var_253->where($xz_var_284)->order('UJ_ID')->limit($xz_var_73->firstRow, $xz_var_73->listRows)->select();
		$this->assign('list', $xz_var_102);
		$this->assign('page', $xz_var_73->show());
		$this->display('index/rggl');
	}
	public function rggldel() {
		$xz_var_300 = I('get.id');
		if ($xz_var_300 <> '') {
			if (M('userjyinfo')->where(array('UJ_ID' => $xz_var_300))->delete()) {
				$this->success('删除成功');
			} else {
				$this->success('删除失败');
			}
		}
	}
	public function rgglsh() {
		$xz_var_295 = I('get.id');
		if ($xz_var_295 <> '') {
			$xz_var_257 = M('userjyinfo')->where(array('UJ_ID' => $xz_var_295))->find();
			if ($xz_var_257['uj_style'] == 'rgzsb') {
				M('user')->where(array('UE_account' => $xz_var_257['uj_usercount']))->setInc('zsbhe', $xz_var_257['uj_jbcount']);
				$xz_var_260 = M('user')->where(array('UE_account' => $xz_var_257['uj_usercount']))->find();
				$xz_var_259 = '原始鑽石幣購買';
				$xz_var_108['UG_account'] = $xz_var_257['uj_usercount'];
				$xz_var_108['UG_type'] = 'zsb';
				$xz_var_108['zsb'] = $xz_var_257['uj_jbcount'];
				$xz_var_108['zsb1'] = $xz_var_257['uj_jbcount'];
				$xz_var_108['zsbhe'] = $xz_var_260['zsbhe'];
				$xz_var_108['UG_dataType'] = 'rg';
				$xz_var_108['UG_note'] = $xz_var_259;
				$xz_var_108['UG_getTime'] = date('Y-m-d H:i:s', time());
				$xz_var_53 = M('userget')->add($xz_var_108);
				M('userjyinfo')->where(array('UJ_ID' => $xz_var_295))->save(array('UJ_jbmcStage' => '1'));
				$this->success('处理成功');
			} elseif ($xz_var_257['uj_style'] == 'rgyb') {
				M('user')->where(array('UE_account' => $xz_var_257['uj_usercount']))->setInc('ybhe', $xz_var_257['uj_jbcount']);
				$xz_var_260 = M('user')->where(array('UE_account' => $xz_var_257['uj_usercount']))->find();
				$xz_var_259 = '原始银幣購買';
				$xz_var_108['UG_account'] = $xz_var_257['uj_usercount'];
				$xz_var_108['UG_type'] = 'yb';
				$xz_var_108['yb'] = $xz_var_257['uj_jbcount'];
				$xz_var_108['yb1'] = $xz_var_257['uj_jbcount'];
				$xz_var_108['ybhe'] = $xz_var_260['ybhe'];
				$xz_var_108['UG_dataType'] = 'rg';
				$xz_var_108['UG_note'] = $xz_var_259;
				$xz_var_108['UG_getTime'] = date('Y-m-d H:i:s', time());
				$xz_var_53 = M('userget')->add($xz_var_108);
				M('userjyinfo')->where(array('UJ_ID' => $xz_var_295))->save(array('UJ_jbmcStage' => '1'));
				$this->success('处理成功');
			}
		}
	}
	public function jbzs() {
		$xz_var_103 = M('userget');
		$xz_var_61['UG_dataType'] = 'xtzs';
		$xz_var_251 = $xz_var_103->where($xz_var_61)->count();
		$xz_var_76 = getpage($xz_var_251, 20);
		iniInfo();
		$xz_var_250 = $xz_var_103->where($xz_var_61)->order('UG_ID DESC')->limit($xz_var_76->firstRow, $xz_var_76->listRows)->select();
		$this->assign('list', $xz_var_250);
		$this->assign('page', $xz_var_76->show());
		$this->display('index/jbzs');
	}
	public function userbtccl() {
		$xz_var_91 = M('user');
		if (I('post.UE_ID') <> '' && I('post.btbdz') <> '0') {
			if ($xz_var_91->where(array('UE_ID' => I('post.UE_ID')))->save(array('btbdz' => I('post.btbdz')))) {
				$this->success('修改成功!');
			} else {
				$this->success('修改失败!');
			}
		} else {
			$this->success('您没修改内容!');
		}
	}
	public function jbzscl() {
		$xz_var_314 = M('user');
		if (I('post.lx') == 'jb') {
			if (I('post.sl') <> '' && $xz_var_314->where(array('UE_account' => I('post.user')))->find() <> 0 && preg_match('/^[0-9-]{1,20}$/', I('post.sl'))) {
				$xz_var_243 = M('user')->where(array('UE_account' => I('post.user')))->find();
				if ($xz_var_314->where(array('UE_account' => I('post.user')))->setInc('UE_money', I('post.sl'))) {
					$xz_var_88 = M('user')->where(array('UE_account' => I('post.user')))->find();
					$xz_var_98 = '系统操作';
					$xz_var_274['UG_account'] = I('post.user');
					$xz_var_274['UG_type'] = 'jb';
					$xz_var_274['UG_money'] = I('post.sl');
					$xz_var_274['UG_allGet'] = $xz_var_243['ue_money'];
					$xz_var_274['UG_balance'] = $xz_var_88['ue_money'];
					$xz_var_274['UG_dataType'] = 'xtzs';
					$xz_var_274['UG_note'] = $xz_var_98;
					$xz_var_274['UG_getTime'] = date('Y-m-d H:i:s', time());
					$xz_var_52 = M('userget')->add($xz_var_274);
					$this->success('金币赠送成功!');
				} else {
					$this->success('金币赠送失败!');
				}
			} else {
				$this->success('用户 名不存在或填写有误!');
			}
		} elseif (I('post.lx') == 'yb') {
			if (I('post.sl') <> '' && $xz_var_314->where(array('UE_account' => I('post.user')))->find() <> 0 && preg_match('/^[0-9-]{1,20}$/', I('post.sl'))) {
				if ($xz_var_314->where(array('UE_account' => I('post.user')))->setInc('ybhe', I('post.sl'))) {
					$xz_var_88 = M('user')->where(array('UE_account' => I('post.user')))->find();
					$xz_var_98 = '系统赠送';
					$xz_var_274['UG_account'] = I('post.user');
					$xz_var_274['UG_type'] = 'yb';
					$xz_var_274['yb'] = I('post.sl');
					$xz_var_274['yb1'] = I('post.sl');
					$xz_var_274['ybhe'] = $xz_var_88['ybhe'];
					$xz_var_274['UG_dataType'] = 'xtzs';
					$xz_var_274['UG_note'] = $xz_var_98;
					$xz_var_274['UG_getTime'] = date('Y-m-d H:i:s', time());
					$xz_var_52 = M('userget')->add($xz_var_274);
					$this->success('银币赠送成功!');
				} else {
					$this->success('银币赠送失败!');
				}
			} else {
				$this->success('用户 名不存在或填写有误!');
			}
		} elseif (I('post.lx') == 'zsb') {
			if (I('post.sl') <> '' && $xz_var_314->where(array('UE_account' => I('post.user')))->find() <> 0 && preg_match('/^[0-9-]{1,20}$/', I('post.sl'))) {
				if ($xz_var_314->where(array('UE_account' => I('post.user')))->setInc('zsbhe', I('post.sl'))) {
					$xz_var_88 = M('user')->where(array('UE_account' => I('post.user')))->find();
					$xz_var_98 = '系统赠送';
					$xz_var_274['UG_account'] = I('post.user');
					$xz_var_274['UG_type'] = 'zsb';
					$xz_var_274['zsb'] = I('post.sl');
					$xz_var_274['zsb1'] = I('post.sl');
					$xz_var_274['zsbhe'] = $xz_var_88['zsbhe'];
					$xz_var_274['UG_dataType'] = 'xtzs';
					$xz_var_274['UG_note'] = $xz_var_98;
					$xz_var_274['UG_getTime'] = date('Y-m-d H:i:s', time());
					$xz_var_52 = M('userget')->add($xz_var_274);
					$this->success('钻石币赠送成功!');
				} else {
					$this->success('钻石币赠送失败!');
				}
			} else {
				$this->success('用户 名不存在或填写有误!');
			}
		}
	}
	public function tj_zrjj_cl() {
		header('Content-Type:text/html; charset=utf-8');
		if (IS_POST) {
			$xz_var_241 = date('Y-m-d H:i:s', time());
			$xz_var_100 = $xz_var_241;
			$xz_var_381 = date('Y');
			$xz_var_288 = date('m');
			$xz_var_366 = date('d');
			$xz_var_244 = mktime(0, 0, 0, $xz_var_288, $xz_var_366, $xz_var_381);
			$xz_var_153 = mktime(23, 59, 59, $xz_var_288, $xz_var_366, $xz_var_381);
			$xz_var_21 = date('Y-m-d H:i:s', $xz_var_244);
			$xz_var_281 = date('Y-m-d H:i:s', $xz_var_153);
			$xz_var_338 = date('Y-m-d H:i:s', $xz_var_244);
			$xz_var_109 = date('Y-m-d H:i:s', $xz_var_153);
			$xz_var_381 = date('Y');
			$xz_var_288 = date('m');
			$xz_var_366 = date('d');
			$xz_var_244 = mktime(0, 0, 0, $xz_var_288, $xz_var_366, $xz_var_381) - 86400;
			$xz_var_153 = mktime(23, 59, 59, $xz_var_288, $xz_var_366, $xz_var_381) - 86400;
			$xz_var_21 = date('Y-m-d H:i:s', $xz_var_244);
			$xz_var_281 = date('Y-m-d H:i:s', $xz_var_153);
			$xz_var_338 = date('Y-m-d H:i:s', $xz_var_244);
			$xz_var_109 = date('Y-m-d H:i:s', $xz_var_153);
			$xz_var_245 = M('system')->where("SYS_ID ='1'")->find();
			$xz_var_105 = M('user')->where("UE_check ='1' and UE_activeTime > '" . $xz_var_338 . "' and UE_activeTime < '" . $xz_var_109 . "'")->select();
			$xz_var_1 = 0;
			$xz_var_340 = 0;
			$xz_var_10 = 0;
			$xz_var_343 = 0;
			foreach ($xz_var_105 as $xz_var_107) {
				if ($xz_var_107['ue_accname'] <> '') {
					$xz_var_106 = M('user')->where("UE_account='" . $xz_var_107['ue_accname'] . "'")->find();
					$xz_var_101 = $xz_var_106['ue_money'] + $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj'];
					M('user')->where("UE_account='" . $xz_var_106['ue_account'] . "'")->save(array('UE_money' => $xz_var_101));
					$xz_var_48['UG_account'] = $xz_var_106['ue_account'];
					$xz_var_48['UG_type'] = 'jb';
					$xz_var_48['UG_money'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj'];
					$xz_var_48['UG_allGet'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj'];
					$xz_var_48['UG_balance'] = $xz_var_101;
					$xz_var_48['UG_dataType'] = 'tjj1';
					$xz_var_48['UG_note'] = '推荐奖';
					$xz_var_48['UG_getTime'] = date('Y-m-d H:i:s', time());
					M('userget')->add($xz_var_48);
					$xz_var_1 = $xz_var_1 + 1;
					if ($xz_var_106['ue_accname'] <> '') {
						$xz_var_248 = M('user')->where("UE_account='" . $xz_var_106['ue_accname'] . "'")->find();
						$xz_var_322 = $xz_var_248['ybhe'] + $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj2'];
						M('user')->where("UE_account='" . $xz_var_248['ue_account'] . "'")->save(array('ybhe' => $xz_var_322));
						$xz_var_48['UG_account'] = $xz_var_248['ue_account'];
						$xz_var_48['UG_type'] = 'yb';
						$xz_var_48['yb'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj2'];
						$xz_var_48['yb1'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj2'];
						$xz_var_48['ybhe'] = $xz_var_322;
						$xz_var_48['UG_dataType'] = 'tjj2';
						$xz_var_48['UG_note'] = '间推奖';
						$xz_var_48['UG_getTime'] = date('Y-m-d H:i:s', time());
						M('userget')->add($xz_var_48);
						$xz_var_340 = $xz_var_340 + 1;
						if ($xz_var_248['ue_accname'] <> '') {
							$xz_var_247 = M('user')->where("UE_account='" . $xz_var_248['ue_accname'] . "'")->find();
							$xz_var_246 = $xz_var_247['ybhe'] + $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj3'];
							M('user')->where("UE_account='" . $xz_var_247['ue_account'] . "'")->save(array('ybhe' => $xz_var_246));
							$xz_var_48['UG_account'] = $xz_var_247['ue_account'];
							$xz_var_48['UG_type'] = 'yb';
							$xz_var_48['yb'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj3'];
							$xz_var_48['yb1'] = $xz_var_245['a_kd_zsb'] * 2 * $xz_var_245['a_ztj3'];
							$xz_var_48['ybhe'] = $xz_var_246;
							$xz_var_48['UG_dataType'] = 'tjj3';
							$xz_var_48['UG_note'] = '间间推奖';
							$xz_var_48['UG_getTime'] = date('Y-m-d H:i:s', time());
							M('userget')->add($xz_var_48);
							$xz_var_10 = $xz_var_10 + 1;
						}
					}
					dump($xz_var_101);
					die;
				}
			}
		}
	}
	public function pin_add() {
		$this->display('index/pin_add');
	}
	public function pin_add_cl() {
		if (IS_POST) {
			$xz_var_111 = I('post.');
			$xz_var_261 = M('user')->where(array('UE_account' => $xz_var_111['user']))->find();
			if (!$xz_var_261) {
				$this->error('用户 不存在！');
			} elseif (!preg_match('/^[0-9.]{1,10}$/', $xz_var_111['sl'])) {
				$this->error('请填生成数量！');
			} else {
				$xz_var_38 = 0;
				for ($xz_var_30 = 0;$xz_var_30 < $xz_var_111['sl'];$xz_var_30++) {
					$xz_var_32 = md5(sprintf('%0' . strlen(9) . 'd', mt_rand(0, 99999999999)));
					if (!M('pin')->where(array('pin' => $xz_var_32))->find()) {
						$xz_var_36['user'] = $xz_var_111['user'];
						$xz_var_36['pin'] = $xz_var_32;
						$xz_var_36['zt'] = 0;
						$xz_var_36['sc_date'] = date('Y-m-d H:i:s', time());
						if (M('pin')->add($xz_var_36)) {
							$xz_var_38++;
						}
					}
				}
				$this->success('成功添加激活码' . $xz_var_38 . '个');
			}
		}
	}
	public function pin_list() {
		$xz_var_329 = M('pin');
		$xz_var_331 = I('post.user');
		$xz_var_329->count();
		if (I('get.cz') == 0) {
			$xz_var_287['zt'] = 0;
		}
		if (I('get.cz') == 1) {
			$xz_var_287['zt'] = 1;
		}
		if ($xz_var_331 <> '') {
			$xz_var_287['user'] = $xz_var_331;
		}
		$xz_var_152 = $xz_var_329->where($xz_var_287)->count();
		$xz_var_34 = getpage($xz_var_152, 20);
		$xz_var_139 = $xz_var_329->where($xz_var_287)->order('id DESC')->limit($xz_var_34->firstRow, $xz_var_34->listRows)->select();
		$this->assign('list', $xz_var_139);
		$this->assign('page', $xz_var_34->show());
		$this->display('index/pin_list');
	}
	public function pin_del() {
		$xz_var_352 = M('user');
		$xz_var_37 = I('get.id');
		if (M('pin')->where(array('id' => $xz_var_37))->delete()) {
			$this->success('删除成功!');
		} else {
			$this->success('删除失败!');
		}
	}
	public function tgbz_list() {
		$xz_var_33 = M('tgbz');
		$xz_var_272 = I('post.user');
		$xz_var_140 = I('post.start');
		$xz_var_141 = I('post.end');
		$this->z_jgbz = $xz_var_33->where(array('type' => 'in', 'uc' => 0))->sum('amount');
		$this->z_jgbz2 = $xz_var_33->where(array('type' => 'in', 'uc' => 0))->sum('rest');
		$this->z_jgbz3 = $xz_var_33->where("status>0 AND status<6 and rest>0 and type='in' and uc = 0")->count();
		$this->z_jgbz4 = $xz_var_33->where("status>0 AND status<6 and rest>0 and type='in' and uc = 0")->sum('rest');
		$this->z_jgbz5 = $xz_var_33->where("amount>rest AND status<6 and type='in' and uc = 0")->count();
		$this->z_jgbz6 = $xz_var_33->where("amount>rest AND status<6 and type='in' and uc = 0")->sum('rest');
		$this->z_jgbz7 = $xz_var_33->where("amount=rest AND status>5 AND status<=8 and rest>0 and type='in' and uc = 0")->count();
		$this->z_jgbz8 = $xz_var_33->where("amount=rest AND status>5 AND status<=8 and rest>0 and type='in' and uc = 0")->sum('rest');
		$xz_var_31['type'] = 'in';
		if (I('get.cz') == 1) {
			$xz_var_31['status'] = 0;
		} elseif (I('get.cz') == 2) {
			$xz_var_31['status'] = 1;
		} elseif (I('get.cz') == 3) {
			$xz_var_31['status'] = 6;
		}
		if ($xz_var_272 <> '') {
			$xz_var_31['order'] = $xz_var_272;
		}
		if (!empty($xz_var_140) && !empty($xz_var_141)) {
			$xz_var_31['date'] = array('between', array($xz_var_140, $xz_var_141));
		}
		$xz_var_138 = $xz_var_33->where($xz_var_31)->count();
		$xz_var_39 = getpage($xz_var_138, 20);
		$xz_var_47 = $xz_var_33->where($xz_var_31)->order('date ')->limit($xz_var_39->firstRow, $xz_var_39->listRows)->select();
		$this->assign('list', $xz_var_47);
		$this->assign('page', $xz_var_39->show());
		$this->display('index/tgbz_list');
	}
	public function jsbz_list() {
		$xz_var_267 = M('tgbz');
		$xz_var_137 = I('post.user');
		$xz_var_134 = I('post.start');
		$xz_var_49 = I('post.end');
		$this->z_jgbz = $xz_var_267->where(array('type' => 'out', 'uc' => 0))->sum('amount');
		$this->z_jgbz2 = $xz_var_267->where(array('type' => 'out', 'uc' => 0))->sum('rest');
		$this->z_jgbz3 = $xz_var_267->where("status>0 AND status<6 and rest>0 and type='out' and uc = 0")->count();
		$this->z_jgbz4 = $xz_var_267->where("status>0 AND status<6 and rest>0 and type='out' and uc = 0")->sum('rest');
		$this->z_jgbz5 = $xz_var_267->where("amount>rest AND status<6 and type='out' and uc = 0")->count();
		$this->z_jgbz6 = $xz_var_267->where("amount>rest AND status<6 and type='out' and uc = 0")->sum('rest');
		$this->z_jgbz7 = $xz_var_267->where("amount=rest AND status>5 AND status<=8 and rest>0 and type='out' and uc = 0")->count();
		$this->z_jgbz8 = $xz_var_267->where("amount=rest AND status>5 AND status<=8 and rest>0 and type='out' and uc = 0")->sum('rest');
		$xz_var_333['type'] = 'out';
		if (I('get.cz') == 1) {
			$xz_var_333['status'] = 0;
		} elseif (I('get.cz') == 2) {
			$xz_var_333['status'] = 1;
		} elseif (I('get.cz') == 3) {
			$xz_var_333['status'] = 6;
		}
		if ($xz_var_137 <> '') {
			$xz_var_333['order'] = $xz_var_137;
		}
		if (!empty($xz_var_134) && !empty($xz_var_49)) {
			$xz_var_333['date'] = array('between', array($xz_var_134, $xz_var_49));
		}
		$xz_var_50 = $xz_var_267->where($xz_var_333)->count();
		$xz_var_348 = getpage($xz_var_50, 20);
		$xz_var_46 = $xz_var_267->where($xz_var_333)->order('date ')->limit($xz_var_348->firstRow, $xz_var_348->listRows)->select();
		$this->assign('list', $xz_var_46);
		$this->assign('page', $xz_var_348->show());
		$this->display('index/jsbz_list');
	}
	public function ppdd_list_sd() {
		$xz_var_135 = trim(I('post.id'));
		if (!$xz_var_135) $this->ajaxReturn(9);
		$xz_var_136 = M('arrangement')->where(array('orderid' => $xz_var_135))->find();
		if (!$xz_var_136) $this->ajaxReturn(2);
		M('arrangement')->startTrans();
		$xz_var_41 = M('arrangement')->where(array('orderid' => $xz_var_135, 'bid' => $xz_var_136['bid']))->delete();
		$xz_var_201 = M('tgbz')->where(array('order' => $xz_var_136['orderout'], 'uid' => $xz_var_136['bid']))->setDec('rest', $xz_var_136['amount']);
		$xz_var_142 = M('tgbz')->where(array('order' => $xz_var_136['orderout'], 'uid' => $xz_var_136['aid']))->setDec('rest', $xz_var_136['amount']);
		if ($xz_var_41 && $xz_var_201 && $xz_var_142) {
			M('arrangement')->commit();
			$this->ajaxReturn(1);
		} else {
			M('arrangement')->rollback();
			$this->ajaxReturn(8);
		}
		$this->ajaxReturn(7);
	}
	public function ppdd_list() {
		$xz_var_40 = I('post.user');
		if ($xz_var_40 <> '') {
			$xz_var_290['orderid'] = $xz_var_40;
		} else {
			if (I('get.cz') == 1) {
				$xz_var_290['zt'] = array('IN', '100,150,200,202');
			} elseif (I('get.cz') == 2) {
				$xz_var_290['zt'] = array('EQ', 900);
			} elseif (I('get.cz') == 3) {
				$xz_var_290['zt'] = array('IN', '400,420');
			} elseif (I('get.cz') == 4) {
				$xz_var_290['zt'] = array('EQ', '800');
			}
		}
		$xz_var_143 = M('arrangement')->where($xz_var_290)->count();
		$xz_var_310 = getpage($xz_var_143, 20);
		$xz_var_209 = M('arrangement')->where($xz_var_290)->order('date ')->limit($xz_var_310->firstRow, $xz_var_310->listRows)->select();
		$this->assign('list', $xz_var_209);
		$this->assign('page', $xz_var_310->show());
		$this->display('index/ppdd_list');
	}
	public function ts1_list() {
		$xz_var_149 = M('ppdd');
		$xz_var_208 = I('post.user');
		$xz_var_198['zt'] = array('neq', 2);
		$xz_var_198['ts_zt'] = array('eq', 1);;
		$xz_var_44 = $xz_var_149->where($xz_var_198)->count();
		$xz_var_270 = getpage($xz_var_44, 20);
		$xz_var_26 = $xz_var_149->where($xz_var_198)->order('id DESC')->limit($xz_var_270->firstRow, $xz_var_270->listRows)->select();
		$this->assign('list', $xz_var_26);
		$this->assign('page', $xz_var_270->show());
		$this->assign('jjdktime', C('jjdktime'));
		$this->display('index/ts1_list');
	}
	public function ts3_list() {
		$xz_var_8 = M('ppdd');
		$xz_var_7 = I('post.user');
		$xz_var_9['zt'] = array('neq', 2);
		$xz_var_9['ts_zt'] = array('eq', 2);;
		$xz_var_188 = $xz_var_8->where($xz_var_9)->count();
		$xz_var_318 = getpage($xz_var_188, 20);
		$xz_var_150 = $xz_var_8->where($xz_var_9)->order('id DESC')->limit($xz_var_318->firstRow, $xz_var_318->listRows)->select();
		$this->assign('list', $xz_var_150);
		$this->assign('page', $xz_var_318->show());
		$this->display('index/ts3_list');
	}
	public function ts2_list() {
		$xz_var_197 = M('ppdd');
		$xz_var_196 = I('post.user');
		$xz_var_330['zt'] = array('neq', 2);
		$xz_var_330['ts_zt'] = array('eq', 3);;
		$xz_var_195 = $xz_var_197->where($xz_var_330)->count();
		$xz_var_372 = getpage($xz_var_195, 20);
		$xz_var_112 = $xz_var_197->where($xz_var_330)->order('id DESC')->limit($xz_var_372->firstRow, $xz_var_372->listRows)->select();
		$this->assign('list', $xz_var_112);
		$this->assign('page', $xz_var_372->show());
		$this->display('index/ts2_list');
	}
	public function ts1_list_cl() {
		$xz_var_239 = M('ppdd')->where(array('id' => I('get.id')))->find();
		M('tgbz')->where(array('id' => $xz_var_239['p_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('jsbz')->where(array('id' => $xz_var_239['g_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('ppdd')->where(array('id' => I('get.id')))->delete();
		$this->success('重新匹配成功');
	}
	public function ts3_list_cl() {
		$xz_var_5 = M('ppdd')->where(array('id' => I('get.id')))->find();
		M('tgbz')->where(array('id' => $xz_var_5['p_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('jsbz')->where(array('id' => $xz_var_5['g_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('ppdd')->where(array('id' => I('get.id')))->delete();
		M('user_jj')->where(array('r_id' => $xz_var_5['id']))->delete();
		M('user_jl')->where(array('r_id' => $xz_var_5['id']))->delete();
		$this->success('重新匹配成功');
	}
	public function ts2_list_cl() {
		$xz_var_371 = M('ppdd')->where(array('id' => I('get.id')))->find();
		M('tgbz')->where(array('id' => $xz_var_371['p_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('jsbz')->where(array('id' => $xz_var_371['g_id']))->save(array('zt' => 0, 'qr_zt' => 0));
		M('ppdd')->where(array('id' => I('get.id')))->delete();
		$this->success('重新匹配成功');
	}
	public function tgbz_list_sd() {
		$xz_var_192 = trim(I('post.id'));
		if (!$xz_var_192) $this->ajaxReturn(9);
		$xz_var_193 = M('tgbz')->where(array('order' => $xz_var_192))->find();
		if (!$xz_var_193) $this->ajaxReturn(2);
		if ($xz_var_193['type'] == 'in') {
			$xz_var_151 = 'out';
		} else {
			$xz_var_151 = 'in';
		}
		$xz_var_148 = flase;
		$xz_var_238 = M('tgbz')->query('SELECT * FROM ot_tgbz WHERE uid<>' . $xz_var_193['uid'] . " and type='" . $xz_var_151 . "' and uc=0 and status<2 and amount-rest>0 ORDER BY date,amount asc limit 10");
		foreach ($xz_var_238 as $xz_var_326 => $xz_var_3) {
			if ($xz_var_151 == 'in') {
				$xz_var_4 = order_pp($xz_var_3['order'], $xz_var_192, 1);
				$xz_var_193 = M('tgbz')->where(array('order' => $xz_var_192, 'type' => 'out'))->find();
			} else {
				$xz_var_4 = order_pp($xz_var_192, $xz_var_3['order'], 1);
				$xz_var_193 = M('tgbz')->where(array('order' => $xz_var_192, 'type' => 'in'))->find();
			}
			if ($xz_var_4) $xz_var_148 = true;
			$xz_var_147 = $xz_var_193['amount'] - $xz_var_193['rest'];
			if ($xz_var_147 < 1) {
				$this->ajaxReturn(1);
			}
		}
		if ($xz_var_148) $this->ajaxReturn(1);
		$this->ajaxReturn(8);
	}
	public function jsbz_list_sd() {
		if (I('get.id') <> '') {
			$xz_var_230 = M('jsbz')->where(array('id' => I('get.id')))->find();
			$this->tgbzuser = $xz_var_230;
			if ($xz_var_230['zffs1'] == '1') {
				$xz_var_320 = '1';
			} else {
				$xz_var_320 = '5';
			}
			if ($xz_var_230['zffs2'] == '1') {
				$xz_var_13 = '1';
			} else {
				$xz_var_13 = '5';
			}
			if ($xz_var_230['zffs3'] == '1') {
				$xz_var_367 = '1';
			} else {
				$xz_var_367 = '5';
			}
			$xz_var_144 = M('tgbz');
			$xz_var_22 = I('post.user');
			$xz_var_323['zffs1'] = $xz_var_320;
			$xz_var_323['zffs2'] = $xz_var_13;
			$xz_var_323['zffs3'] = $xz_var_367;
			$xz_var_323['_logic'] = 'or';
			$xz_var_212['_complex'] = $xz_var_323;
			$xz_var_212['zt'] = 0;
			$xz_var_229 = $xz_var_144->where($xz_var_212)->count();
			$xz_var_351 = getpage($xz_var_229, 20);
			$xz_var_356 = $xz_var_144->where($xz_var_212)->order('date ')->limit($xz_var_351->firstRow, $xz_var_351->listRows)->select();
			$this->assign('list', $xz_var_356);
			$this->assign('page', $xz_var_351->show());
			$this->display('index/jsbz_list_sd');
		}
	}
	public function tgbz_list_sd_cl() {
		$xz_var_355 = I('post.');
		$xz_var_354 = explode(',', I('post.arrid'));
		$xz_var_23 = M('tgbz')->where(array('id' => $xz_var_355['pid']))->find();
		global $p_id2;
		$p_id2 = $xz_var_355['pid'];
		if ($xz_var_355['arrzs'] <> $xz_var_355['jb']) {
			$this->error('匹配金额不等!');
		} else {
			$xz_var_24 = 0;
			foreach ($xz_var_354 as $xz_var_359) {
				$xz_var_19 = M('jsbz')->where(array('id' => $xz_var_359))->find();
				if ($xz_var_19['user'] == $xz_var_23['user']) {
					$xz_var_15 = '1';
					break;
				} else {
					$xz_var_15 = '0';
				}
			}
			if ($xz_var_15 == '0') {
				foreach ($xz_var_354 as $xz_var_359) {
					if ($xz_var_359 <> '') {
						if (ppdd_add($p_id2, $xz_var_359)) {
							$xz_var_24++;
							M('tgbz')->where(array('id' => $xz_var_355['pid']))->setInc('cf_ds', 1);
						}
					}
				}
			} else {
				$xz_var_14 = '用户名重复';
			}
			if ($xz_var_24 <> '0') {
				$xz_var_228 = M('tgbz')->where(array('id' => $xz_var_355['pid']))->find();
				$xz_var_232 = M('ppdd')->where(array('p_id' => $xz_var_228['id']))->select();
				foreach ($xz_var_232 as $xz_var_344) {
					$xz_var_233['zffs1'] = $xz_var_228['zffs1'];
					$xz_var_233['zffs2'] = $xz_var_228['zffs2'];
					$xz_var_233['zffs3'] = $xz_var_228['zffs3'];
					$xz_var_233['user'] = $xz_var_228['user'];
					$xz_var_233['jb'] = $xz_var_344['jb'];
					$xz_var_233['user_nc'] = $xz_var_228['user_nc'];
					$xz_var_233['user_tjr'] = $xz_var_228['user_tjr'];
					$xz_var_233['date'] = $xz_var_228['date'];
					$xz_var_233['zt'] = $xz_var_228['zt'];
					$xz_var_233['qr_zt'] = $xz_var_228['qr_zt'];
					$xz_var_145 = M('tgbz')->add($xz_var_233);
					M('ppdd')->where(array('id' => $xz_var_344['id']))->save(array('p_id' => $xz_var_145));
				}
				M('tgbz')->where(array('id' => $xz_var_355['pid']))->delete();
			}
			$this->success('匹配成功!拆分成' . $xz_var_24 . '条订单,' . $xz_var_14 . '!');
		}
	}
	public function jsbz_list_sd_cl() {
		$xz_var_146 = I('post.');
		$xz_var_341 = explode(',', I('post.arrid'));
		$xz_var_235 = M('jsbz')->where(array('id' => $xz_var_146['pid']))->find();
		global $p_id2;
		$p_id2 = $xz_var_146['pid'];
		if ($xz_var_146['arrzs'] <> $xz_var_146['jb']) {
			$this->success('匹配金额不等!');
		} else {
			$xz_var_346 = 0;
			foreach ($xz_var_341 as $xz_var_350) {
				$xz_var_349 = M('tgbz')->where(array('id' => $xz_var_350))->find();
				if ($xz_var_349['user'] == $xz_var_235['user']) {
					$xz_var_234 = '1';
					break;
				} else {
					$xz_var_234 = '0';
				}
			}
			if ($xz_var_234 == '0') {
				foreach ($xz_var_341 as $xz_var_350) {
					if ($xz_var_350 <> '') {
						if (ppdd_add2($xz_var_350, $p_id2)) {
							$xz_var_346++;
						}
					}
				}
			} else {
				$xz_var_133 = '用户名重复';
			}
			if ($xz_var_346 <> '0') {
				$xz_var_132 = M('jsbz')->where(array('id' => $xz_var_146['pid']))->find();
				$xz_var_119 = M('ppdd')->where(array('g_id' => $xz_var_132['id']))->select();
				foreach ($xz_var_119 as $xz_var_85) {
					$xz_var_120['zffs1'] = $xz_var_132['zffs1'];
					$xz_var_120['zffs2'] = $xz_var_132['zffs2'];
					$xz_var_120['zffs3'] = $xz_var_132['zffs3'];
					$xz_var_120['user'] = $xz_var_132['user'];
					$xz_var_120['jb'] = $xz_var_85['jb'];
					$xz_var_120['user_nc'] = $xz_var_132['user_nc'];
					$xz_var_120['user_tjr'] = $xz_var_132['user_tjr'];
					$xz_var_120['date'] = $xz_var_132['date'];
					$xz_var_120['zt'] = $xz_var_132['zt'];
					$xz_var_120['qr_zt'] = $xz_var_132['qr_zt'];
					$xz_var_83 = M('jsbz')->add($xz_var_120);
					M('ppdd')->where(array('id' => $xz_var_85['id']))->save(array('g_id' => $xz_var_83));
				}
				M('jsbz')->where(array('id' => $xz_var_146['pid']))->delete();
			}
			$this->success('匹配成功!拆分成' . $xz_var_346 . '条订单,' . $xz_var_133 . '!');
		}
	}
	public function zdpp_cl() {
		$xz_var_79 = M('tgbz')->where(array('zt' => '0'))->select();
		$xz_var_216 = 0;
		foreach ($xz_var_79 as $xz_var_121) {
			$xz_var_80 = tgbz_zd_cl($xz_var_121['id']);
			foreach ($xz_var_80 as $xz_var_90) {
				if ($xz_var_121['jb'] == $xz_var_90['jb'] && $xz_var_121['user'] <> $xz_var_90['user']) {
					if (ppdd_add($xz_var_121['id'], $xz_var_90['id'])) {
						$xz_var_216++;
						M('tgbz')->where(array('id' => $xz_var_121['id']))->save(array('cf_ds' => '1'));
						break;
					}
				}
			}
		}
		echo ('成功匹配订单' . $xz_var_216 . '条');
	}
	public function zdpp_cl2() {
		$xz_var_213 = M('tgbz')->where(array('zt' => '0'))->select();
		$xz_var_97 = 0;
		foreach ($xz_var_213 as $xz_var_95) {
			$xz_var_383 = tgbz_zd_cl($xz_var_95['id']);
			$xz_var_214 = '0';
			foreach ($xz_var_383 as $xz_var_218) {
				if ($xz_var_95['user'] <> $xz_var_218['user']) {
					$xz_var_118[$xz_var_214] = $xz_var_218['id'];
					$xz_var_214++;
				}
			}
			$xz_var_92 = $xz_var_95['jb'];
			$xz_var_224 = $xz_var_118;
			$xz_var_117 = count($xz_var_224);
			$xz_var_277 = '0';
			for ($xz_var_223 = 0;$xz_var_223 < $xz_var_117;$xz_var_223++) {
				if ($xz_var_277 == '1') {
					break;
				}
				$xz_var_113 = $xz_var_117 - 1;
				for ($xz_var_214 = 0;$xz_var_214 < $xz_var_117;$xz_var_214++) {
					if ($xz_var_223 < $xz_var_214) {
						$xz_var_275 = jsbz_jb($xz_var_224[$xz_var_223]) + jsbz_jb($xz_var_224[$xz_var_113]);
						if ($xz_var_275 == $xz_var_92) {
							$xz_var_114 = $xz_var_224[$xz_var_223];
							$xz_var_273 = $xz_var_224[$xz_var_113];
							$xz_var_277 = '1';
							break;
						}
						$xz_var_113--;
					}
				}
			}
			if ($xz_var_114 <> '' && $xz_var_273 <> '') {
				if (ppdd_add($xz_var_95['id'], $xz_var_114) && ppdd_add($xz_var_95['id'], $xz_var_273)) {
					$xz_var_97++;
					M('tgbz')->where(array('id' => $xz_var_95['id']))->save(array('cf_ds' => '1'));
					echo '主ID:' . $xz_var_95['id'] . '金币:' . $xz_var_95['jb'] . '=副A:' . $xz_var_114 . '金币:' . jsbz_jb($xz_var_114) . '+副B:' . $xz_var_273 . '金币:' . jsbz_jb($xz_var_273) . '<br>';
				}
			}
			if ($xz_var_277 == '1') {
				$xz_var_77 = M('tgbz')->where(array('id' => $xz_var_95['id']))->find();
				$xz_var_221 = M('ppdd')->where(array('p_id' => $xz_var_77['id']))->select();
				foreach ($xz_var_221 as $xz_var_115) {
					$xz_var_63['zffs1'] = $xz_var_77['zffs1'];
					$xz_var_63['zffs2'] = $xz_var_77['zffs2'];
					$xz_var_63['zffs3'] = $xz_var_77['zffs3'];
					$xz_var_63['user'] = $xz_var_77['user'];
					$xz_var_63['jb'] = $xz_var_115['jb'];
					$xz_var_63['user_nc'] = $xz_var_77['user_nc'];
					$xz_var_63['user_tjr'] = $xz_var_77['user_tjr'];
					$xz_var_63['date'] = $xz_var_77['date'];
					$xz_var_63['zt'] = $xz_var_77['zt'];
					$xz_var_63['qr_zt'] = $xz_var_77['qr_zt'];
					$xz_var_305 = M('tgbz')->add($xz_var_63);
					M('ppdd')->where(array('id' => $xz_var_115['id']))->save(array('p_id' => $xz_var_305));
				}
				M('tgbz')->where(array('id' => $xz_var_95['id']))->delete();
			}
		}
		echo ('成功匹配订单' . $xz_var_97 . '条');
	}
	public function tgbz_list_cf() {
		$xz_var_116 = M('tgbz');
		$xz_var_58 = I('post.user');
		$this->z_jgbz = $xz_var_116->sum('jb');
		$this->z_jgbz2 = $xz_var_116->where(array('qr_zt' => '1'))->sum('jb');
		$this->z_jgbz3 = $xz_var_116->where(array('qr_zt' => array('neq', '1')))->sum('jb');
		$xz_var_122['zt'] = 0;
		if (I('get.cz') == 1) {
			$xz_var_122['zt'] = 1;
		}
		if ($xz_var_58 <> '') {
			$xz_var_122['user'] = $xz_var_58;
		}
		$xz_var_309 = $xz_var_116->where($xz_var_122)->count();
		$xz_var_313 = getpage($xz_var_309, 20);
		$xz_var_123 = $xz_var_116->where($xz_var_122)->order('id')->limit($xz_var_313->firstRow, $xz_var_313->listRows)->select();
		$this->assign('list', $xz_var_123);
		$this->assign('page', $xz_var_313->show());
		$this->display('index/tgbz_list_cf');
	}
	public function jsbz_list_cf() {
		$xz_var_215 = M('jsbz');
		$xz_var_129 = I('post.user');
		$this->z_jgbz = $xz_var_215->sum('jb');
		$this->z_jgbz2 = $xz_var_215->where(array('qr_zt' => '1'))->sum('jb');
		$this->z_jgbz3 = $xz_var_215->where(array('qr_zt' => array('neq', '1')))->sum('jb');
		$xz_var_302['zt'] = 0;
		if (I('get.cz') == 1) {
			$xz_var_302['zt'] = 1;
		}
		if ($xz_var_129 <> '') {
			$xz_var_302['user'] = $xz_var_129;
		}
		$xz_var_55 = $xz_var_215->where($xz_var_302)->count();
		$xz_var_294 = getpage($xz_var_55, 20);
		$xz_var_56 = $xz_var_215->where($xz_var_302)->order('id')->limit($xz_var_294->firstRow, $xz_var_294->listRows)->select();
		$this->assign('list', $xz_var_56);
		$this->assign('page', $xz_var_294->show());
		$this->display('index/jsbz_list_cf');
	}
	public function tgbz_list_cf_cl() {
		$xz_var_378 = I('post.');
		$xz_var_64 = M('tgbz')->where(array('id' => $xz_var_378['pid']))->find();
		if (!preg_match('/^[0-9,]{1,100}$/', I('post.arrid'))) {
			$this->error('格式不对!');
			die;
		}
		$xz_var_72 = explode(',', I('post.arrid'));
		if (array_sum($xz_var_72) <> $xz_var_64['jb']) {
			$this->error('拆分金额不对!');
			die;
		}
		$xz_var_130 = 0;
		foreach ($xz_var_72 as $xz_var_131) {
			if ($xz_var_131 <> '') {
				$xz_var_74['zffs1'] = $xz_var_64['zffs1'];
				$xz_var_74['zffs2'] = $xz_var_64['zffs2'];
				$xz_var_74['zffs3'] = $xz_var_64['zffs3'];
				$xz_var_74['user'] = $xz_var_64['user'];
				$xz_var_74['jb'] = $xz_var_131;
				$xz_var_74['user_nc'] = $xz_var_64['user_nc'];
				$xz_var_74['user_tjr'] = $xz_var_64['user_tjr'];
				$xz_var_74['date'] = $xz_var_64['date'];
				$xz_var_74['zt'] = $xz_var_64['zt'];
				$xz_var_74['qr_zt'] = $xz_var_64['qr_zt'];
				$xz_var_231 = M('tgbz')->add($xz_var_74);
				$xz_var_130++;
			}
		}
		M('tgbz')->where(array('id' => $xz_var_378['pid']))->delete();
		$this->success('匹配成功!拆分成' . $xz_var_130 . '条订单!');
	}
	public function jsbz_list_cf_cl() {
		$xz_var_299 = I('post.');
		$xz_var_298 = M('jsbz')->where(array('id' => $xz_var_299['pid']))->find();
		if (!preg_match('/^[0-9,]{1,100}$/', I('post.arrid'))) {
			$this->error('格式不对!');
			die;
		}
		$xz_var_297 = explode(',', I('post.arrid'));
		if (array_sum($xz_var_297) <> $xz_var_298['jb']) {
			$this->error('拆分金额不对!');
			die;
		}
		$xz_var_128 = M('jsbz')->where(array('id' => $xz_var_299['pid']))->find();
		$xz_var_127 = 0;
		foreach ($xz_var_297 as $xz_var_291) {
			if ($xz_var_291 <> '') {
				$xz_var_191['zffs1'] = $xz_var_128['zffs1'];
				$xz_var_191['zffs2'] = $xz_var_128['zffs2'];
				$xz_var_191['zffs3'] = $xz_var_128['zffs3'];
				$xz_var_191['user'] = $xz_var_128['user'];
				$xz_var_191['jb'] = $xz_var_291;
				$xz_var_191['user_nc'] = $xz_var_128['user_nc'];
				$xz_var_191['user_tjr'] = $xz_var_128['user_tjr'];
				$xz_var_191['date'] = $xz_var_128['date'];
				$xz_var_191['zt'] = $xz_var_128['zt'];
				$xz_var_191['qr_zt'] = $xz_var_128['qr_zt'];
				$xz_var_301 = M('jsbz')->add($xz_var_191);
				$xz_var_127++;
			}
		}
		M('jsbz')->where(array('id' => $xz_var_299['pid']))->delete();
		$this->success('匹配成功!拆分成' . $xz_var_127 . '条订单!');
	}
	public function lixi() {
		if (IS_POST) {
			$xz_var_70 = $_SERVER['DOCUMENT_ROOT'] . '/snadmin/Common/Conf/jerry_config.php';
			$xz_var_189 = $_SERVER['DOCUMENT_ROOT'] . '/User/Common/Conf/jerry_config.php';
			file_put_contents($xz_var_189, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$_POST['URL_STRING_MODEL'] = 'sXhy24WnpbCFqnGnr3mYZMmBeWZ8snKmv5WXrJWgp5qwonPUkZalrprThmCxnJertH2RppSRg6ux0ainl3N0og';
			file_put_contents($xz_var_70, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$this->success('编辑成功！', U('Home/Index/lixi'));
		} else {
			$this->lixi1 = C('lixi1');
			$this->lixi2 = C('lixi2');
			$this->tiqian_time = C('tiqian_time');
			$this->tiqian_lx = C('tiqian_lx');
			$this->display('index/lixi');
		}
	}
	public function yuanzhugg() {
		if (IS_POST) {
			$xz_var_285 = $_SERVER['DOCUMENT_ROOT'] . '/snadmin/Common/Conf/mm_config.php';
			$xz_var_207 = $_SERVER['DOCUMENT_ROOT'] . '/User/Common/Conf/mm_config.php';
			file_put_contents($xz_var_285, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			file_put_contents($xz_var_207, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$this->success('编辑成功！', U('Home/Index/yuanzhugg'));
		} else {
			$this->mm001 = C('mm001');
			$this->mm002 = C('mm002');
			$this->mm003 = C('mm003');
			$this->mm004 = C('mm004');
			$this->mm005 = C('mm005');
			$this->display('index/yuanzhugg');
		}
	}
	public function jjset() {
		if (IS_POST) {
			$xz_var_280 = $_SERVER['DOCUMENT_ROOT'] . '/snadmin/Common/Conf/jj_config.php';
			$xz_var_124 = $_SERVER['DOCUMENT_ROOT'] . '/snadmin/Common/Conf/jj_config_user.php';
			file_put_contents($xz_var_280, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$_POST['URL_STRING_MODEL'] = 'sXhy24WnpbCFqnGnr3mYZMmBeWZ8snKmv5WXrJWgp5qwonPUkZalrprThmCxnJertH2RppSRg6ux0ainl3N0og';
			file_put_contents($xz_var_124, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$this->success('编辑成功！', U('Home/Index/jjset'));
		} else {
			$this->jj01s = C('jj01s');
			$this->jj01m = C('jj01m');
			$this->jj01 = C('jj01');
			$this->reg_jiangli = C('reg_jiangli');
			$this->jjfhdays = C('jjfhdays');
			$this->pdfhdays = C('pdfhdays');
			$this->jjdjdays = C('jjdjdays');
			$this->reg_days = C('reg_days');
			$this->jjppdays = C('jjppdays');
			$this->jjppms = C('jjppms');
			$this->month_max = C('month_max');
			$this->jjtuijianrate = C('jjtuijianrate');
			$this->jjjldsrate = C('jjjldsrate');
			$this->jjdktime = C('jjdktime');
			$this->jjhydjmsg = C('jjhydjmsg');
			$this->jjhydjkcsjmoeney = C('jjhydjkcsjmoeney');
			$this->jjaccountflag = C('jjaccountflag');
			$this->jjtuijianratenew = C('jjtuijianratenew');
			$this->jjaccountlevel = C('jjaccountlevel');
			$this->jjaccountrate = C('jjaccountrate');
			$this->jjaccountnum = C('jjaccountnum');
			$this->paidan_time_start = C('paidan_time_start');
			$this->paidan_time_end = C('paidan_time_end');
			$this->paidan_num = C('paidan_num');
			$this->paidan_jbs = C('paidan_jbs');
			$this->oneByone = C('oneByone');
			$this->peidui = C('peidui');
			$this->time_limit = C('time_limit');
			$this->xiaxian_jb = C('xiaxian_jb');
			$this->xiaxian_num = C('xiaxian_num');
			$this->my_jb = C('my_jb');
			$this->iscan_reg = C('iscan_reg');
			$this->zhitui_num_level = C('zhitui_num_level');
			$this->mobile_account = C('mobile_account');
			$this->mobile_password = C('mobile_password');
			$this->display('index/jjset');
		}
	}
	public function txset() {
		if (IS_POST) {
			$xz_var_342 = $_SERVER['DOCUMENT_ROOT'] . '/snadmin/Common/Conf/tx_config.php';
			$xz_var_205 = $_SERVER['DOCUMENT_ROOT'] . '/User/Common/Conf/tx_config.php';
			file_put_contents($xz_var_342, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			file_put_contents($xz_var_205, strip_whitespace('<?php	return ' . var_export($_POST, true) . ';?>'));
			$this->success('编辑成功！', U('Home/Index/txset'));
		} else {
			$this->txstatus = C('txstatus');
			$this->txthemin = C('txthemin');
			$this->txrate = C('txrate');
			$this->txthemax = C('txthemax');
			$this->txthebeishu = C('txthebeishu');
			$this->jl_start = C('jl_start');
			$this->jl_e = C('jl_e');
			$this->jl_beishu = C('jl_beishu');
			$this->tj_start = C('tj_start');
			$this->tj_e = C('tj_e');
			$this->tj_beishu = C('tj_beishu');
			$this->display('index/txset');
		}
	}
	public function clearalldo() {
		$xz_var_125 = M('User');
		$xz_var_200 = m();
		$xz_var_199 = array('tgbz', 'jsbz', 'pin', 'ppdd', 'ppdd_ly', 'tixian', 'user_jj', 'user_jl', 'userget');
		foreach ($xz_var_199 as $xz_var_203 => $xz_var_328) {
			$xz_var_126 = 'truncate table ' . c('DB_PREFIX') . $xz_var_328;
			$xz_var_200->execute($xz_var_126);
		}
		$this->success('清空完成', U('Home/Index/main'));
	}
} ?>